<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class UserInbox extends Model
{
    //
    protected $table = 'inbox';

    protected $fillable = ['id','user_id','dialog_id','message', 'semder_remove', 'recipient_remove', 'receipt'];

    /**
     * 发送者用户信息
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function userinfo() {
        return $this->belongsTo('App\User', 'user_id');
    }

    /**
     * 接收者用户信息
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function receiptinfo() {
        return $this->belongsTo('App\User', 'receipt');
    }

}
